class Fruit:
    def makejuice(self):
        print('i can make juice ')
class Apple(Fruit):
    def makejuice(self):
        print('i can make  apple juice ')
class Banana(Fruit):
    def makejuice(self):
        print('i can make Banana juice ')
class Orange(Fruit):
    def makejuice(self):
        print('i can make Orange juice ')
# 利用多态。  定义一个service  公共方法接口
def service(inst):
    inst.makejuice()

# apple = Apple()
# apple.makejuice()  # 以往的方式，需要用一个调用一个
# banana = Banana()
# banana.makejuice()  # 橘子也是 一样
# orange = Orange()
# orange.makejuice()

# 利用接口
apple = Apple()
banana = Banana()
orange = Orange()
for i in (apple,banana,orange):
    service(i)
